#ifndef VOICE_FILE_H_
#define VOICE_FILE_H_

#include <stdint.h>

#define CONFIG_VOICE_MAX_NAME_LEN       40 //fixed

#define EBADF       0x5001 /* bad file descriptor */
#define EINVAL      0x5002 /* invalid argument */
#define EACCES      0x5003 /* permission denied */
#define ENOMEM      0x5004 /* not enough memory */
#define EBUSY       0x5005 /* device or resource busy */
//#define EINVAL      0x5006 /* sinvalid argument */
#define ENOSPC      0x5007 /* no space on device */
#define ENOENT      0x5008 /* [no such file or directory */
#define EMFILE      0x5009 /* too many files open */
#define ENAMETOOLONG    0x5010 /* filename too long */

#define VOICE_ERR_OPEN_DEV  -2700
#define VOICE_ERR_PARAM     -2701
#define VOICE_ERR_OPEN_FILE -2702
#define VOICE_ERR_FILE_SIZE -2703
#define VOICE_ERR_FILE_READ -2704
#define VOICE_ERR_FILE_TYPE -2705

typedef struct {
    char name[CONFIG_VOICE_MAX_NAME_LEN];/*File name*/
    uint16_t bitsPerSample;
    uint16_t samplesPerSec;
    uint32_t offset; /* File first addr: part offset*/
    uint32_t fsize;  /* File size */
    uint32_t fptr;   /* File R pointer */
}voice_file_t;

int voice_part_init(void);
int voice_ctrl_volume(uint32_t vol);
int voice_file_play(char * pszFile);

#endif /* RESOURCE_H_ */
